﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VietPay.KooBoo.Business.Interfaces;
using VietPay.KooBoo.Business;
using VietPay.KooBoo.Business.Models;

namespace VietPay.WebSales.Controllers
{
    public class BatchDetailController : Controller
    {
        private IBatchDetailService _batchService;

        public BatchDetailController()
            : this(new BatchDetailService())
        {

        }

        public BatchDetailController(IBatchDetailService batchService)
        {
            _batchService = batchService;
        }

        //
        // GET: /SalesModule/News/

        #region //private
        private List<SelectListItem> _Status = new List<SelectListItem>();
        public List<SelectListItem> Status
        {
            get
            {
                _Status.Add(new SelectListItem() { Text = "Đang phân phối", Value = "1" });
                _Status.Add(new SelectListItem() { Text = "Hoàn thành", Value = "2" });
                return _Status;
            }
        }

        #endregion

        public ActionResult Index(int batchID, string batchCode)
        {
            BatchDetailViewModel batchViewModel = new BatchDetailViewModel();
            var nlst = _batchService.GetBatchDetailList(batchID, 100, 1);
            if (nlst == null)
            {
                return HttpNotFound();
            }
            ViewData["BatchCode"] = batchCode;
            return View(nlst);
        }

        public ActionResult BatchReportDetail(int batchID, string batchCode)
        {
            BatchDetailViewModel batchViewModel = new BatchDetailViewModel();
            var nlst = _batchService.GetBatchDetailList(batchID, 100, 1);
            if (nlst == null)
            {
                return HttpNotFound();
            }
            ViewData["BatchCode"] = batchCode;
            return View(nlst);
        }
    }
}
